const db = require("../db")
const { querySql , queryOne }=require("../db")
const { UPLOAD_PATH } = require('../utils/constant')
var fs = require('fs');

function exists(data){
    return false
}

 function removeUser(data){
    return  new Promise( async (resolve,reject)=>{
        try{
            if(data.id){
                const removeBookSql = `delete from fs_user where id='${data.id}'`
                await db.querySql(removeBookSql)
                resolve()
            }
        }catch(e){
            reject()
        }
    
   })
   
}




function getUserList(){//获取用户数据
    return querySql(`select * from fs_user`)
}



function getCreate(data){//查询活动的详情
    return queryOne(`select * from fs_centrelist where id='${data.id}'`)
}




function updataCentre(data){//更新活动
    return  new Promise( async (resolve,reject)=>{
        try{
            await db.update(data,'fs_centrelist',`where id='${data.id}'`)
           
            resolve()
            
         }catch(e){
             reject()
         }
    
   })
}








module.exports = {
    getUserList,
    removeUser
}